import type { AppRouteModule } from '@/router/types';
import { LAYOUT } from '@/router/constant';
import { PermissionEnum } from '@/enums/permissionEnum'

const route: AppRouteModule = {
  path: '/system',
  name: 'system',
  component: LAYOUT,
  redirect: '/system',
  meta: {
    orderNo: 9000,
    icon: 'ion:settings-outline',
    title: '系统管理',
  },
  children: [
    {
      path: 'index',
      name: 'system',
      component: () => import('@/views/wex/system/system/index.vue'),
      meta: {
        title: '企业信息',
        permissions: [PermissionEnum.ORGANIZATION_INFO_MANAGE],
      },
    },
    {
      path: 'key',
      name: 'key',
      component: () => import('@/views/wex/system/key/index.vue'),
      meta: {
        title: '密钥管理',
        permissions: [PermissionEnum.ENCRYPT_MANAGER],
      },
    },
    {
      path: 'user',
      name: 'user',
      component: () => import('@/views/wex/system/user/index.vue'),
      meta: {
        title: '用户管理',
        permissions: [PermissionEnum.USER_MANAGE],
      },
    },
    {
      path: 'role',
      name: 'role',
      component: () => import('@/views/wex/system/role/index.vue'),
      meta: {
        title: '角色管理',
        permissions: [PermissionEnum.ROLE_MANAGE],
      },
    },
    {
      path: 'menu',
      name: 'MenuManagement',
      meta: {
        title: '菜单管理',
        ignoreKeepAlive: true,
      },
      component: () => import('@/views/wex/system/menu/index.vue'),
    },
    {
      path: 'profile',
      name: 'profile',
      component: () => import('@/views/wex/system/profile/index.vue'),
      meta: {
        title: '个人资料',
      },
    },
    {
      path: 'password',
      name: 'password',
      component: () => import('@/views/wex/system/password/index.vue'),
      meta: {
        title: '修改密码',
      },
    },
    {
      path: 'deploy',
      name: 'deploy',
      component: () => import('@/views/wex/system/deploy/index.vue'),
      meta: {
        title: '系统部署',
      },
    },
    {
      path: 'log',
      name: 'log',
      component: () => import('@/views/wex/system/log/index.vue'),
      meta: {
        title: '操作记录',
        permissions: [PermissionEnum.OPERATION_LOG_VIEW],
      },
    },
  ],
};

export default route;
